FAILURE MAP
← Case archive

FA-48061 / Delimited text / Open access

A copy cell substitutes a sentinel instead of the numeric base · case 01

A structured table violates the declared record or column contract.

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

ROOT CAUSE

The copy branch does not resolve its prior numeric value.

VERIFIED REPAIR

Preserve the named invariant at the faulty decision: value = previous[i]

Unsuccessful approach: Substituting zero loses the inherited value just as surely.

Case contract

Decode two-column semicolon rows. A first row must contain absolute ASCII integer cells prefixed =. Later cells may use signed integer deltas prefixed + or -, or =absolute. A caret copies prior column value. Return numeric rows. Empty tokens and noncanonical nondecimal tokens reject.

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, previous = [], None
    for line in data:
        cells = line.split(';')
        if len(cells) != 2: return None
        row = []
        for i, cell in enumerate(cells):
            if cell == '^':
                if previous is None: return None
                value = -1
            else:
                if not cell or cell[0] not in '=+-': return None
                digits = cell[1:]
                if not digits.isascii() or not digits.isdecimal(): return None
                amount = int(digits)
                if cell[0] == '=': value = amount
                else:
                    if previous is None: return None
                    value = previous[i] + (amount if cell[0] == '+' else -amount)
            row.append(value)
        rows.append(row)
        previous = row
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('deltas', solve(_vary(['=10;=20', '+3;-2', '-1;+4'])), _vary([[10, 20], [13, 18], [12, 22]]))
check('absolute reset', solve(_vary(['=10;=20', '=1;^', '+2;+3'])), _vary([[10, 20], [1, 20], [3, 23]]))
check('initial delta', solve(_vary(['+1;=2'])), _vary(None))
check('initial copy', solve(_vary(['^;=2'])), _vary(None))
check('bad amount', solve(_vary(['=a;=2'])), _vary(None))
check('empty amount', solve(_vary(['=;=2'])), _vary(None))
check('empty table', solve(_vary([])), _vary([]))
check('zero deltas', solve(_vary(['=0;=1', '+0;-0'])), _vary([[0, 1], [0, 1]]))
check('variant delta magnitude', solve(['='+str(N)+';=2','+3;-1']), [[N,2],[N+3,1]])
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
deltas[[10, 20], [13, 18], [12, 22]][[10, 20], [13, 18], [12, 22]]Passed
absolute reset[[10, 20], [1, -1], [3, 2]][[10, 20], [1, 20], [3, 23]]Failed
initial deltaNoneNonePassed
initial copyNoneNonePassed
bad amountNoneNonePassed
empty amountNoneNonePassed
empty table[][]Passed
zero deltas[[0, 1], [0, 1]][[0, 1], [0, 1]]Passed
variant delta magnitude[[1, 2], [4, 1]][[1, 2], [4, 1]]Passed

SHA-256 / f90f4fd3e249614d83f2ad3ba93e7661cca0e77fec5249f60140cf9adb81a8f5

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, previous = [], None
    for line in data:
        cells = line.split(';')
        if len(cells) != 2: return None
        row = []
        for i, cell in enumerate(cells):
            if cell == '^':
                if previous is None: return None
                value = 0
            else:
                if not cell or cell[0] not in '=+-': return None
                digits = cell[1:]
                if not digits.isascii() or not digits.isdecimal(): return None
                amount = int(digits)
                if cell[0] == '=': value = amount
                else:
                    if previous is None: return None
                    value = previous[i] + (amount if cell[0] == '+' else -amount)
            row.append(value)
        rows.append(row)
        previous = row
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('deltas', solve(_vary(['=10;=20', '+3;-2', '-1;+4'])), _vary([[10, 20], [13, 18], [12, 22]]))
check('absolute reset', solve(_vary(['=10;=20', '=1;^', '+2;+3'])), _vary([[10, 20], [1, 20], [3, 23]]))
check('initial delta', solve(_vary(['+1;=2'])), _vary(None))
check('initial copy', solve(_vary(['^;=2'])), _vary(None))
check('bad amount', solve(_vary(['=a;=2'])), _vary(None))
check('empty amount', solve(_vary(['=;=2'])), _vary(None))
check('empty table', solve(_vary([])), _vary([]))
check('zero deltas', solve(_vary(['=0;=1', '+0;-0'])), _vary([[0, 1], [0, 1]]))
check('variant delta magnitude', solve(['='+str(N)+';=2','+3;-1']), [[N,2],[N+3,1]])
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
deltas[[10, 20], [13, 18], [12, 22]][[10, 20], [13, 18], [12, 22]]Passed
absolute reset[[10, 20], [1, 0], [3, 3]][[10, 20], [1, 20], [3, 23]]Failed
initial deltaNoneNonePassed
initial copyNoneNonePassed
bad amountNoneNonePassed
empty amountNoneNonePassed
empty table[][]Passed
zero deltas[[0, 1], [0, 1]][[0, 1], [0, 1]]Passed
variant delta magnitude[[1, 2], [4, 1]][[1, 2], [4, 1]]Passed

SHA-256 / de2005c1313377bdb48ec7120bd7fc08575b0112802dd7ea586dbe7db264a585

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, previous = [], None
    for line in data:
        cells = line.split(';')
        if len(cells) != 2: return None
        row = []
        for i, cell in enumerate(cells):
            if cell == '^':
                if previous is None: return None
                value = previous[i]
            else:
                if not cell or cell[0] not in '=+-': return None
                digits = cell[1:]
                if not digits.isascii() or not digits.isdecimal(): return None
                amount = int(digits)
                if cell[0] == '=': value = amount
                else:
                    if previous is None: return None
                    value = previous[i] + (amount if cell[0] == '+' else -amount)
            row.append(value)
        rows.append(row)
        previous = row
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('deltas', solve(_vary(['=10;=20', '+3;-2', '-1;+4'])), _vary([[10, 20], [13, 18], [12, 22]]))
check('absolute reset', solve(_vary(['=10;=20', '=1;^', '+2;+3'])), _vary([[10, 20], [1, 20], [3, 23]]))
check('initial delta', solve(_vary(['+1;=2'])), _vary(None))
check('initial copy', solve(_vary(['^;=2'])), _vary(None))
check('bad amount', solve(_vary(['=a;=2'])), _vary(None))
check('empty amount', solve(_vary(['=;=2'])), _vary(None))
check('empty table', solve(_vary([])), _vary([]))
check('zero deltas', solve(_vary(['=0;=1', '+0;-0'])), _vary([[0, 1], [0, 1]]))
check('variant delta magnitude', solve(['='+str(N)+';=2','+3;-1']), [[N,2],[N+3,1]])
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
deltas[[10, 20], [13, 18], [12, 22]][[10, 20], [13, 18], [12, 22]]Passed
absolute reset[[10, 20], [1, 20], [3, 23]][[10, 20], [1, 20], [3, 23]]Passed
initial deltaNoneNonePassed
initial copyNoneNonePassed
bad amountNoneNonePassed
empty amountNoneNonePassed
empty table[][]Passed
zero deltas[[0, 1], [0, 1]][[0, 1], [0, 1]]Passed
variant delta magnitude[[1, 2], [4, 1]][[1, 2], [4, 1]]Passed

SHA-256 / f1a45284208d4d9c532ea3d95cbdf32421516676586ebf6ebdba9f50f2614f4a

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

Case digest / 3e38c15874d8dcaf1699307d931fdcbcea10bd883cd51813478cbb4dbb26edaf