FAILURE MAP
← Case archive

FA-48041 / Delimited text / Open access

A negative delta is added to the prior cell · 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 delta sign is discarded when reconstructing a column value.

THE FAILURE

The delta sign is discarded when reconstructing a column value.

Unsuccessful approach: Reversing both signs changes positive deltas too.

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 = 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
            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, 22], [14, 26]][[10, 20], [13, 18], [12, 22]]Failed
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, 3]][[1, 2], [4, 1]]Failed

SHA-256 / ff7bfd553733542eabaa43ff0d84ef11c970db3522568b89ed1e9fbadd685b0d

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 = 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], [7, 22], [8, 18]][[10, 20], [13, 18], [12, 22]]Failed
absolute reset[[10, 20], [1, 20], [-1, 17]][[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], [-2, 3]][[1, 2], [4, 1]]Failed

SHA-256 / 5c09fb08efaa6cb368221ce07e5d84b19f76fedcada636b0346c8d391b33ab70

HELD IN THE MEMBER ARCHIVE

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

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

Case digest / c7a2b03b80a17ba717c58de4f7e5a8591cf02fa36d76094511e278459a889b1d