FAILURE MAP
← Case archive

FA-47831 / Delimited text / Open access

An inclusive column endpoint omits its last requested cell · 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 final requested physical field is excluded.

VERIFIED REPAIR

Preserve the named invariant at the faulty decision: row[cstart-1:cend]

Unsuccessful approach: Expanding the endpoint overshoots when a following field exists.

Case contract

Select physical cells from a rectangular table using one-based inclusive row and column intervals. Omitted end means last; zero and reversed or out-of-range bounds reject. An empty table accepts only both default [1,null] selectors and produces empty output. Preserve selected order.

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):
    rows = data['rows']
    rstart, rend = data['r']
    cstart, cend = data['c']
    if not rows: return [] if data['r'] == [1, None] and data['c'] == [1, None] else None
    height, width = len(rows), len(rows[0])
    if any(len(row) != width for row in rows): return None
    rend = height if rend is None else rend
    cend = width if cend is None else cend
    if not 1 <= rstart <= rend <= height: return None
    if not 1 <= cstart <= cend <= width: return None
    return [row[cstart-1:cend-1] for row in rows[rstart-1:rend]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('window', solve(_vary({'rows': [['a', 'b', 'c'], ['d', '@', 'f'], ['g', 'h', 'i']], 'r': [2, 3], 'c': [2, 3]})), _vary([['@', 'f'], ['h', 'i']]))
check('full', solve(_vary({'rows': [['@', 'x']], 'r': [1, None], 'c': [1, None]})), _vary([['@', 'x']]))
check('zero', solve(_vary({'rows': [['x']], 'r': [0, 1], 'c': [1, 1]})), _vary(None))
check('reversed', solve(_vary({'rows': [['a'], ['b']], 'r': [2, 1], 'c': [1, 1]})), _vary(None))
check('row overflow', solve(_vary({'rows': [['a']], 'r': [1, 2], 'c': [1, 1]})), _vary(None))
check('col overflow', solve(_vary({'rows': [['a']], 'r': [1, 1], 'c': [1, 2]})), _vary(None))
check('ragged', solve(_vary({'rows': [['a', 'b'], ['c']], 'r': [1, 1], 'c': [1, 1]})), _vary(None))
check('empty', solve(_vary({'rows': [], 'r': [1, None], 'c': [1, None]})), _vary([]))
check('prefix window', solve(_vary({'rows': [['@', 'b'], ['c', 'd']], 'r': [1, 1], 'c': [1, 1]})), _vary([['@']]))
check('empty explicit', solve(_vary({'rows': [], 'r': [1, 1], 'c': [1, 1]})), _vary(None))
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
window[['cell'], ['h']][['cell', 'f'], ['h', 'i']]Failed
full[['cell']][['cell', 'x']]Failed
zeroNoneNonePassed
reversedNoneNonePassed
row overflowNoneNonePassed
col overflowNoneNonePassed
raggedNoneNonePassed
empty[][]Passed
prefix window[[]][['cell']]Failed
empty explicitNoneNonePassed

SHA-256 / 9bd8641928679aa87ee9310712c79436df184af258ba5e8ef321b83047bd2679

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):
    rows = data['rows']
    rstart, rend = data['r']
    cstart, cend = data['c']
    if not rows: return [] if data['r'] == [1, None] and data['c'] == [1, None] else None
    height, width = len(rows), len(rows[0])
    if any(len(row) != width for row in rows): return None
    rend = height if rend is None else rend
    cend = width if cend is None else cend
    if not 1 <= rstart <= rend <= height: return None
    if not 1 <= cstart <= cend <= width: return None
    return [row[cstart-1:cend+1] for row in rows[rstart-1:rend]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('window', solve(_vary({'rows': [['a', 'b', 'c'], ['d', '@', 'f'], ['g', 'h', 'i']], 'r': [2, 3], 'c': [2, 3]})), _vary([['@', 'f'], ['h', 'i']]))
check('full', solve(_vary({'rows': [['@', 'x']], 'r': [1, None], 'c': [1, None]})), _vary([['@', 'x']]))
check('zero', solve(_vary({'rows': [['x']], 'r': [0, 1], 'c': [1, 1]})), _vary(None))
check('reversed', solve(_vary({'rows': [['a'], ['b']], 'r': [2, 1], 'c': [1, 1]})), _vary(None))
check('row overflow', solve(_vary({'rows': [['a']], 'r': [1, 2], 'c': [1, 1]})), _vary(None))
check('col overflow', solve(_vary({'rows': [['a']], 'r': [1, 1], 'c': [1, 2]})), _vary(None))
check('ragged', solve(_vary({'rows': [['a', 'b'], ['c']], 'r': [1, 1], 'c': [1, 1]})), _vary(None))
check('empty', solve(_vary({'rows': [], 'r': [1, None], 'c': [1, None]})), _vary([]))
check('prefix window', solve(_vary({'rows': [['@', 'b'], ['c', 'd']], 'r': [1, 1], 'c': [1, 1]})), _vary([['@']]))
check('empty explicit', solve(_vary({'rows': [], 'r': [1, 1], 'c': [1, 1]})), _vary(None))
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
window[['cell', 'f'], ['h', 'i']][['cell', 'f'], ['h', 'i']]Passed
full[['cell', 'x']][['cell', 'x']]Passed
zeroNoneNonePassed
reversedNoneNonePassed
row overflowNoneNonePassed
col overflowNoneNonePassed
raggedNoneNonePassed
empty[][]Passed
prefix window[['cell', 'b']][['cell']]Failed
empty explicitNoneNonePassed

SHA-256 / b434b4ed919a63bc93a664291814572b5d5e92e8859efd358dc113a8aedda519

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):
    rows = data['rows']
    rstart, rend = data['r']
    cstart, cend = data['c']
    if not rows: return [] if data['r'] == [1, None] and data['c'] == [1, None] else None
    height, width = len(rows), len(rows[0])
    if any(len(row) != width for row in rows): return None
    rend = height if rend is None else rend
    cend = width if cend is None else cend
    if not 1 <= rstart <= rend <= height: return None
    if not 1 <= cstart <= cend <= width: return None
    return [row[cstart-1:cend] for row in rows[rstart-1:rend]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('window', solve(_vary({'rows': [['a', 'b', 'c'], ['d', '@', 'f'], ['g', 'h', 'i']], 'r': [2, 3], 'c': [2, 3]})), _vary([['@', 'f'], ['h', 'i']]))
check('full', solve(_vary({'rows': [['@', 'x']], 'r': [1, None], 'c': [1, None]})), _vary([['@', 'x']]))
check('zero', solve(_vary({'rows': [['x']], 'r': [0, 1], 'c': [1, 1]})), _vary(None))
check('reversed', solve(_vary({'rows': [['a'], ['b']], 'r': [2, 1], 'c': [1, 1]})), _vary(None))
check('row overflow', solve(_vary({'rows': [['a']], 'r': [1, 2], 'c': [1, 1]})), _vary(None))
check('col overflow', solve(_vary({'rows': [['a']], 'r': [1, 1], 'c': [1, 2]})), _vary(None))
check('ragged', solve(_vary({'rows': [['a', 'b'], ['c']], 'r': [1, 1], 'c': [1, 1]})), _vary(None))
check('empty', solve(_vary({'rows': [], 'r': [1, None], 'c': [1, None]})), _vary([]))
check('prefix window', solve(_vary({'rows': [['@', 'b'], ['c', 'd']], 'r': [1, 1], 'c': [1, 1]})), _vary([['@']]))
check('empty explicit', solve(_vary({'rows': [], 'r': [1, 1], 'c': [1, 1]})), _vary(None))
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
window[['cell', 'f'], ['h', 'i']][['cell', 'f'], ['h', 'i']]Passed
full[['cell', 'x']][['cell', 'x']]Passed
zeroNoneNonePassed
reversedNoneNonePassed
row overflowNoneNonePassed
col overflowNoneNonePassed
raggedNoneNonePassed
empty[][]Passed
prefix window[['cell']][['cell']]Passed
empty explicitNoneNonePassed

SHA-256 / a5c13c6bf67800b4ee3502baddd9b32ff615fc78e9537a4d56017170d9f1aed0

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

Case digest / 7456ddbd03fb0b2ec2c6837950851fcbe511520b6e86e3f71bf825b158ce5327